home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
The World of Computer Software.iso
/
eue10.zip
/
USERBANK.PRG
< prev
next >
Wrap
Text File
|
1992-12-29
|
6KB
|
195 lines
*Extended User Editor (userbank) - version 1.0 12/30/92 (c) 1992 James E. Swarm
*
*This version of the program is fully working, and is to be considered
*shareware. If you use this software I ask that you register it with
*a donation to my BBS. Registered users will receive full tdbs source
*(available for download) for both the USERLIST and USEREDIT program.
*A donation is $20.00 or higher... thats up to you, but the better
*responce I get, the more I will update the programs.
*
*Please send all donations to:
*
*James E. Swarm
*
*P.O. Box 361093
*Strongsville, Ohio 44136
*BBS (216)237-4980
*
SET EXCLUSIVE OFF
SET ESCAPE OFF
public f_add1,f_add2,f_city,f_state,f_zip,f_country,f_phone,f_location,f_realn,f_user,f_newubyte,f_newdbyte
public f_age,f_callmday,f_mday,f_ratiou,f_ratiod,f_timebank,f_modify
public sname,answer,handle,counter,up_byte,down_byte
clear
if uansi()
set color to w+
endif
maxday = 120
maxdep = 180
opt = optdata()
rec = at("t",opt)
rec = substr(opt,rec+1)
recend = at(chr(32),rec)
timeu = substr(rec,1,recend -1)
timeu = val(timeu)
daymin = substr(rec,recend+2)
daymin = val(daymin)
timeu = timeu - 1
use "useredit"
set index to "username"
user = uname()
seek user
if .NOT. found()
? ""
? "User Database Record Not Found, please contact sysop."
? ""
wait
quit
endif
do mainmenu
DO WHILE .T.
DO getanser WITH "WDR+",.T.,"+"
DO CASE
CASE answer = "D"
? ""
? "Enter the amount of time you wish to deposit."
accept ": " to sname
if empty(sname)
loop
endif
dtime = val(sname)
if dtime <= 0
loop
endif
if dtime > timeu
? ""
? "You do not have that much time left to deposit."
? ""
wait
do mainmenu
loop
endif
tatime = timeu - dtime
maxdtime = f_timebank + dtime
if maxdtime > maxdep
? ""
? "You have exceeded maximum timebank deposit."
? ""
wait
do mainmenu
loop
endif
timeu = timeu - dtime
if tatime = 0
tatime = 1
endif
replace f_timebank with maxdtime
tatime = tatime + daymin
pokedummy=ulpoke(73,1,tatime)
pokedummy=ulpoke(149,2,tatime)
replace f_timeflag with .t.
tdate = date()
replace f_date with tdate
do mainmenu
loop
CASE answer = "W"
callmday = ulpeek(73,1)
mday = ulpeek(149,2)
? ""
? "Enter the amount of time you wish to withdraw."
accept ": " to sname
wtime = val(sname)
if wtime < 0
loop
endif
if wtime > f_timebank
? ""
? "You do not have that much time in your account."
? ""
wait
do mainmenu
loop
endif
tatime = wtime + timeu
if tatime > maxday
? ""
? "Your total exceeds maximum system withdraw time."
? ""
wait
do mainmenu
loop
endif
if tatime > 255
? ""
? "Your total exceeds maximum system withdraw time."
? ""
wait
do mainmenu
loop
endif
timeu = timeu + wtime
wtime = f_timebank - wtime
replace f_timebank with wtime
tatime = tatime + daymin
pokedummy=ulpoke(73,1,tatime)
pokedummy=ulpoke(149,2,tatime)
replace f_timeflag with .t.
tdate = date()
replace f_date with tdate
do mainmenu
loop
CASE answer = "R"
quit
CASE answer = "+"
do mainmenu
loop
ENDCASE
ENDDO
quit
PROCEDURE getanser
PARAMETER srchstrng, default, def_val
DO WHILE .T.
key = INKEY(0)
IF key = 13 .AND. default
answer = def_val
EXIT
ENDIF
answer = UPPER(CHR(key))
IF .NOT. answer $ srchstrng
LOOP
ENDIF
?? answer
EXIT
ENDDO
RETURN
procedure mainmenu
clear
callmday = ulpeek(73,1)
mday = ulpeek(149,2)
? "Time Bank Menu"
? ""
? "Current Balance : " str(f_timebank,3)
? "Time Used Today : " str(daymin,3)
? "Maximum Deposit Today : " str(timeu,3)
? "Maximum Total Deposit : " str(maxdep,3)
? "Maximum Withdraw Amount : " str(maxday,3)
? ""
? "<D>eposit Time"
? "<W>ithdraw Time"
? "<R>eturn to UserMenu "
? ""
? "Command: "
return